home *** CD-ROM | disk | FTP | other *** search
- /*=====[ The TesSeRact(TM) CXL User Interface Development System ]======*
- | Copyright (c) 1987-1990, Innovative Data Concepts. All Rights Reserved
- |
- | This Library is part of IDC's TesSeRact Development Tools product
- | line. For information about other IDC products, call 1-215-884-3373.
- *----------------------------------------------------------------------*
- | <TCXLdef.h> : TCXL global MS-DOS definitions and function prototypes.
- *-------------------------------[ NOTES ]------------------------------*
- | 1) This file is included by all other <TCXLxxx.h> header files and so
- | need not be included if any of them are.
- | 2) Compiler-dependent definitions are isolated in separate files
- | included here.
- | 3) For all supported MS_DOS compilers, all TCXL functions except those
- | taking variable arguments use the faster, more compact Pascal
- | calling convention, defined as CTYP.
- | 4) The compiler-specific "ANSI Keywords Only" options cannot be used
- | for TCXL, due to use of common extended keywords.
- | 5) The crufty MsXxx() macros exist solely for typecasts to shut up a
- | lot of MEANINGLESS NOISE in the form of warning essages generated
- | by the M$C 5.1 and 6.0 MS-DOS compilers about assigning 8-bit
- | variables to 16-bit values or comparing signed and unsigned
- | values! Just one of the many inane things needed for portability!
- *----------------------------------------------------------------------*
- | PGS : $Id: tcxldef.h 5.51 90/10/01 00:00:00 MLM Release Locker: MLM $
- | $Log: tcxldef.h $
- | Revision 5.51 90/10/01 00:00:00 MLM
- | TCXL 5.51
- |
- *======================================================================*/
- #ifndef _TCXLdef_
- # define _TCXLdef_ 1 /* only once! */
-
- /*--------------------[ Supported MS-DOS compilers ]--------------------*/
-
- # undef _TCXL_cc_
- # undef _TCXL_msc_
- # ifdef __TURBOC__ /* Turbo C 2.0 or Turbo C++ 1.0 or later */
- # include <TCXL_tc.h>
- # else
- # ifdef __ZTC__ /* Zortech C/C++ 2.0 or later */
- # include <TCXL_ztc.h>
- # else
- # ifdef M_I86 /* Micro$oft C 5.1 or later */
- # include <TCXL_msc.h>
- # endif
- # endif
- # endif
- # ifndef _TCXL_cc_
- # error Unsupported Compiler!
- # endif
-
- /*------------------------[ TCXL configuration ]------------------------*/
-
- #define TCXLVER 0x0533 /*- TCXL version = 5.51 ------------------*/
- /*- TcxlSys values -----------------------*/
- #define SYS_DOS 0x0000 /* MS-DOS/PC-DOS/DR_DOS */
- #define SYS_JDS 0x0001 /* Japan DOS */
- #define SYS_OS2 0x0002 /* half an OS <;-)> */
- #define SYS_XNX 0x0003 /* MS/SCO Xenix */
- #define SYS_UNX 0x0004 /* AT&T Unix */
- #define SYS_BSD 0x0005 /* BSD Unix */
- #define SYS_AIX 0x0006 /* IBM AIX */
- #define SYS_VMS 0x0007 /* DEC VMS */
- /*- TcxlEnv bits (DOS) -------------------*/
- #define ENV_MOU 0x0001 /* rodent */
- #define ENV_KEY 0x0002 /* enhanced keyboard */
- #define ENV_UV 0x0004 /* Ultravision */
- #define ENV_ESA 0x0010 /* EISA bus */
- #define ENV_MCA 0x0020 /* MCA bus */
-
- /*----------------[ Portability and shorthand notation ]----------------*/
-
- #define CON const
- #define CTYP PAS
- #define GBL extern
- #define LCL static
- #define REG register
- #define SIZ(c) sizeof(c)
- #define TYP typedef
- #define UNS unsigned
- #define VOID void
- #define VOL volatile
- #ifdef __cplusplus
- # define NOARG /* remove (void) cruft for C++ */
- #else
- # define NOARG void /* leave (void) cruft for C */
- #endif
- #ifdef EOS
- # undef EOS
- #endif
- #define EOS '\x00' /* End_Of_String */
- #ifdef NUL
- # undef NUL /* NulTerm */
- #endif
- #define NUL EOS /* ASCII NULl char */
- #define BEL '\x07' /* Common control codes */
- #define BS '\x08'
- #define HT '\x09'
- #define LF '\x0A'
- #define FF '\x0C'
- #define CR '\x0D'
- #define ESC '\x1B'
- #ifdef EOF
- # undef EOF
- #endif
- #define EOF (-1) /* End_Of_File */
- #define CpmEof '\x1A' /* CP/M-style [PDP-8!] ^Z EOF */
- #define CtlZ CpmEof /* ... alias */
- #ifdef FALSE
- # undef FALSE
- #endif
- #ifdef TRUE
- # undef TRUE
- #endif
- #define FALSE 0 /* Boolean absolutes */
- #define TRUE 1
- #define YES TRUE /* ... aliases */
- #define NO FALSE
- #define ON TRUE
- #define OFF FALSE
-
- /*------------------------[ Error-return values ]-----------------------*/
-
- #define ERR_MEM (-2) /* allocation failure */
- #define ERR_ARG (-1) /* argument failure */
- #define ERR_NUL 0 /* successful return */
- #define ERR_ESC 1 /* [Esc] pressed */
-
- /*---------[ TCXL standard object, pointer and indirect types ]---------*/
- /* Object Pointer Indirect */
- TYP VOID *AnyP, **AnyI; /* anonymous void pointer */
- TYP VOID FAR *AnyFP; /* ... far-pointer */
- TYP char ChrT, *ChrP, **ChrI; /* 8-bit char */
- TYP ChrT FAR *ChrFP; /* ... far-pointer */
- TYP ChrT *StrP, **StrI; /* NulTerm string */
- TYP UNS char BytT, *BytP, **BytI; /* 8-bit unsigned byte */
- TYP BytT FAR *BytFP; /* ... far-pointer */
- TYP BytT FlgT, *FlgP, **FlgI; /* 8-bit Boolean flag */
- TYP short IntT, *IntP, **IntI; /* 16-bit signed int */
- TYP IntT FAR *IntFP; /* ... far-pointer */
- TYP UNS short WrdT, *WrdP, **WrdI; /* 16-bit unsigned word */
- TYP WrdT FAR *WrdFP; /* ... far-pointer */
- TYP long LngT, *LngP, **LngI; /* 32-bit signed long */
- TYP LngT FAR *LngFP; /* ... far-pointer */
- TYP UNS long DwdT, *DwdP, **DwdI; /* 32-bit unsigned dword */
- TYP DwdT FAR *DwdFP; /* ... far-pointer */
- TYP float FltT, *FltP, **FltI; /* 32-bit real */
- TYP double DblT, *DblP, **DblI; /* 64-bit real */
- TYP WrdT LenT, *LenP, **LenI; /* alias for ANSI size_t */
- TYP LngT PosT, *PosP, **PosI; /* alias for ANSI fpos_t */
- TYP WrdT NdxT, *NdxP, **NdxI; /* unsigned array-indices */
- TYP IntT ArgT; /* bytes/chars as ints */
- /*--------------------[ TCXL-specific type-aliases ]--------------------*/
-
- TYP BytT AtrT, *AtrP; /* video attribute */
- TYP WrdT KeyT, *KeyP; /* keycode (char/scan) */
- TYP IntT TagT, *TagP; /* item/field/help tag-id */
- TYP IntT WndT, *WndP; /* window handle */
- #ifdef _TCXL_msc_
- # define MsByt(x) (BytT)(x) /* crufty casts to shut up M$C */
- # define MsAtr(x) (AtrT)(x)
- # define MsChr(x) (ChrT)(x)
- # define MsInt(x) (IntT)(x)
- #else
- # define MsByt(x) (x) /* no crufty casts */
- # define MsAtr(x) (x)
- # define MsChr(x) (x)
- # define MsInt(x) (x)
- #endif
-
- /*------------------[ Common function-pointer types ]-------------------*/
-
- TYP VOID (CTYP *VfvCP)(NOARG); /* VOID (*function)(NOARG) */
- TYP VOID (CTYP *VfiCP)(IntT); /* VOID (*function)(IntT) */
- TYP IntT (CTYP *IfcpCP)(ChrP); /* IntT (*function)(ChrP) */
- TYP WrdT (CTYP *WfipCP)(IntP); /* WrdT (*function)(IntP) */
-
- /*------------------[ Data-objects and access macros ]------------------*/
-
- TYP struct Tcxl TcxlT;
- struct Tcxl /*-[ TCXL-control object ]----*/
- { IntT terr; /* 00|00 : error code */
- IntT tdbg; /* 02|02 : debug-level */
- WrdT tsys; /* 04|04 : operating system */
- WrdT tenv; /* 06|06 : environment bits */
- WrdT tcfg; /* 08|08 : configuration bits */
- }; /* 0A|0A ]--------------------*/
-
- GBL TcxlT CDC _TcxlCtl; /*- global TCXL control object -----------*/
- #define TcxlErr (_TcxlCtl.terr) /* error code */
- #define TcxlDbg (_TcxlCtl.tdbg) /* debug-level */
- #define TcxlSys (_TcxlCtl.tsys) /* system */
- #define TcxlDos (TcxlSys == SYS_DOS) /* DOS */
- #define TcxlJds (TcxlSys == SYS_JDS) /* Japan DOS */
- #define TcxlOs2 (TcxlSys == SYS_OS2) /* OS/2 */
- #define TcxlXnx (TcxlSys == SYS_XNX) /* Xenix */
- #define TcxlUnx (TcxlSys == SYS_UNX) /* AT&T Unix */
- #define TcxlBsd (TcxlSys == SYS_BSD) /* BSD Unix */
- #define TcxlAix (TcxlSys == SYS_AIX) /* IBM AIX */
- #define TcxlVms (TcxlSys == SYS_VMS) /* DEC VMS */
- #define TcxlEnv (_TcxlCtl.tenv) /* environment */
- #define TcxlMou (0 != (TcxlEnv & ENV_MOU)) /* rodent */
- #define TcxlKey (0 != (TcxlEnv & ENV_KEY)) /* 101-key */
- #define TcxlUv (0 != (TcxlEnv & ENV_UV)) /* Ultravision */
- #define TcxlEsa (0 != (TcxlEnv & ENV_ESA)) /* EISA bus */
- #define TcxlMca (0 != (TcxlEnv & ENV_MCA)) /* MCA bus */
- #define TcxlCfg (_TcxlCtl.tcfg) /* configuration */
-
- /*------------------------[ Function prototypes ]-----------------------*/
-
- #ifdef __cplusplus /* no mangling, please */
- extern "C" {
- #endif
- VOID PAS _Delay(WrdT d); /* delay for <d> clock-ticks */
- VOID PAS _StdOut(ArgT ch); /* put char */
- VOID PAS _StdOutS(ChrP s); /* put string */
- DwdT PAS _Timer(NOARG); /* get system timer */
- VOID PAS _WaitMs(IntT ms); /* wait (delay) for <ms> millisec*/
- VOID Beep(NOARG); /* honk the horn */
- ChrP CTYP RandFile(NOARG); /* generate random filename */
- VOID CTYP Sound(WrdT pv, WrdT dt); /* make noise */
- ChrP CTYP SysDate(IntT d); /* system date as string */
- ChrP CTYP SysTime(IntT t); /* system time as string */
- IntT PAS TabNxt(IntT c, IntT w); /* next tab-stop */
- VOID CTYP TcxlInit(NOARG); /* initialize TCXL */
- VOID CDC TcxlTerm(NOARG); /* terminate TCXL */
- WrdP TcxlVer(NOARG); /* get TCXL version number */
- #define Beep() _StdOut(BEL)
- #define TcxlVer() TCXLVER
- #ifdef __cplusplus
- }
- #endif
- #endif /* _TCXLdef_ : End of TCXLDef.h */